For those of you interested, here is the source code listing for the SearchReplace XCMD done in Think Pascal‚Ñ¢. It was compiled and linked with the DRVRRuntime library. Then it was built and saved as a resource of type XCMD and pasted via ResEdit into this stack. The modeless dialog was built in ResEdit.